<!--
	app第一次启动时的轮播页
-->
<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>guide-向导页</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">

	<link rel="stylesheet" href="css/mui.min.css">
	<style>
			#close {
				position: absolute;
				width: 160px;
				height: 44px;
				left: 50%;
				margin-left: -80px;
				bottom: 15%;
				padding: 10px;
				color: #fff;
				border-color: #fff;
			}
			
			img {
				width: 100%;
				height: 100%;
			}
		</style>
</head>

<body>
<div id="con">
	<div id="slider" class="mui-slider mui-fullscreen" style="background-color: black; display: none;">
		<div class="mui-slider-group">
			<!-- 第一张 -->
			<div class="mui-slider-item mui-slider-item-duplicate">
				<img src="images/guide1.jpg">
			</div>
			<!-- 第二张 -->
			<div class="mui-slider-item">
				<img src="images/guide2.jpg">
			</div>
			<!-- 第三张 -->
			<div class="mui-slider-item">
				<img src="images/guide3.jpg">
			</div>
			<!-- 第四张 -->
			<div class="mui-slider-item">
				<img src="images/guide4.jpg">
				<button id='close' class="mui-btn mui-btn-warning mui-btn-outlined">立即体验</button>
			</div>
		</div>
		<div class="mui-slider-indicator">
			<div class="mui-indicator mui-active"></div>
			<div class="mui-indicator"></div>
			<div class="mui-indicator"></div>
			<div class="mui-indicator"></div>
		</div>
	</div>
</div>
<script src="js/mui.min.js"></script>
<script>
			mui.back = function() {};
			mui.plusReady(function() {
				setTimeout(function() {
					mui.preload({
						id: 'login',
						url: 'login.html'
					})
				}, 100);

				//plus.navigator.setFullscreen(true);
				plus.navigator.closeSplashscreen();

				//读取本地存储的“首次启动标志”，检查是否为首次启动
				var showGuide = plus.storage.getItem("lauchFlag");
				if(showGuide) {
					//有值，说明已经显示过了，显示登录画面：
					setTimeout(function() {
						mui.openWindow({
							id: 'login',
							url: 'login.html',
							show: {
								aniShow: 'none'
							},
							waiting: {
								autoShow: true
							}
						});
					}, 100);
				} else {
					//显示启动导航
					document.getElementById('slider').style.display = 'block';
					//获得slider插件对象
					var gallery = mui('.mui-slider');
					gallery.slider({
						interval: 3000 //自动轮播周期，若为0则不自动播放，默认为0；
					});
				}
			});

			//立即体验按钮点击事件
			document.getElementById("close").addEventListener('tap', function(event) {
				//更新启动画片和本地存储，设置“首次启动标志”
				plus.navigator.updateSplashscreen({image:'images/splash.png'});
				plus.storage.setItem("lauchFlag", "true");

				//显示登录画面：
				mui.openWindow({
					id: 'login',
					url: 'login.html',
					show: {
						aniShow: 'none'
					},
					waiting: {
						autoShow: true
					}
				});
				//plus.webview.close(plus.webview.currentWebview());
			}, false);
		</script>
</body>

</html>